//
//  XiaoXiSendVC.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/4/30.
//  Copyright © 2019 SanYi. All rights reserved.
//

#import "XiaoXiSendVC.h"

@interface XiaoXiSendVC ()

@end

@implementation XiaoXiSendVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
- (void)initSubView{
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.tableList];
    [_tableList mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@0);
        make.right.equalTo(@0).offset(0);
        make.top.equalTo(@0);
        make.bottom.equalTo(@0);
    }];
    
    [self.view addSubview:self.nullImageView];
//    _nullImageView.hidden = YES;
    [_nullImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view.mas_centerX);
        make.width.equalTo(@207);
        make.height.equalTo(@196);
        make.centerY.equalTo(self.view.mas_centerY);
    }];
}
- (UITableView *)tableList{
    if (!_tableList) {
        UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 144, self.view.frame.size.width-200, APP_HEIGHT-84) style:UITableViewStylePlain];
        tableView.delegate  =self;
        tableView.dataSource = self;
        tableView.backgroundColor = [UIColor whiteColor];
        [tableView registerClass:[XiaoXiReciveCell class] forCellReuseIdentifier:@"XiaoXiReciveCell"];
        tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableList = tableView;
    }
    return _tableList;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 0;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 20;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    XiaoXiReciveCell *cell = [tableView dequeueReusableCellWithIdentifier:@"XiaoXiReciveCell" forIndexPath:indexPath];
    if (!cell) {
        cell = [[XiaoXiReciveCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"XiaoXiReciveCell"];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    NSLog(@"点击了cell");
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView *view = [[UIView alloc]init];
    view.frame = CGRectMake(0,0, self.view.frame.size.width, 20);
    return view;
}
- (UIImageView *)nullImageView{
    if (!_nullImageView) {
        UIImageView *imageView = [[UIImageView alloc]init];
        imageView.image = [UIImage imageNamed:@"xiaoxi_null"];
        _nullImageView = imageView;
    }
    return _nullImageView;
}
@end
